package com.qfedu.orderadd.controller;

import com.qfedu.fmmall.entity.Orders;
import com.qfedu.fmmall.entity.ShoppingCartVo;
import com.qfedu.orderadd.service.OrderAddService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class OrderAddController {

    @Autowired
    private OrderAddService orderAddService;


    @PostMapping("/order/save")
    public List<ShoppingCartVo> saveOrder(@RequestBody Orders orders, String cids){
        return orderAddService.save(orders,cids);
    }

}
